/*
 * Copyright © 2004-2014 chenYuan. All rights reserved.
 * @Website:wwww.jspx.net
 * @Mail:39793751@qq.com
 * @author: chenYuan , 陈原
 * @License: Jspx.net Framework Code is open source (LGPL)，Jspx.net Framework 使用LGPL 开源授权协议发布。
 * @jvm:jdk1.6+  x86/amd64
 *
 */
package com.jspx.txweb.action;

import com.jspx.boot.environment.Environment;
import com.jspx.boot.sign.LanguageRes;
import com.jspx.txweb.annotation.HttpMethod;
import com.jspx.txweb.annotation.Operate;
import com.jspx.txweb.view.IpLocationView;
import com.jspx.utils.StringUtil;

/**
 * Created with IntelliJ IDEA.
 * User: chenyuan
 * Date: 12-7-16
 * Time: 下午8:32
 *
 */
@HttpMethod(caption="IP定位")
public class IpLocationAction extends IpLocationView {
    public IpLocationAction()
    {

    }
    /**
     * 删除内容,删除条件,1:包含mid列表,并且是在自己管理的栏目中
     * @throws com.jspx.sober.exception.ValidException v
     * @throws Exception e
     */
    @Operate(caption="保存")
    public void save() throws Exception
    {
        if (StringUtil.isNULL(ipLocationDAO.getFileName()))
        {
            addFieldInfo(Environment.warningInfo,language.getLang(LanguageRes.fileNameNotConfig));
            return;
        }
        ipLocationDAO.deleteAll();
        addActionMessage(language.getLang(LanguageRes.importData)+ "," + ipLocationDAO.fileToDataBase());
    }


}